package rickyGame.game.action.state
{
	
	import rickyGame.game.Fighter;
	import rickyGame.game.property.FightPro;
	
	/**
	 * 安装影响战斗的属性状态
	 */
	public class InstallFightSateAct extends StateAct
	{
		public function InstallFightSateAct(actor:Fighter, fightProperty:String,value:Number,endTime:Number)
		{
			super(actor, null, endTime);
			_fightProperty=fightProperty;
			_value=value;
		}
		
		override public function begin():void
		{
			fightpro=Fighter(actor).fightPro;
			if(fightpro[_fightProperty])
				fightpro[_fightProperty].adder=_value;
			super.begin();
		}
		
		override public function end():void
		{
			if(fightpro[_fightProperty])
				fightpro[_fightProperty].adder=-_value;
			super.end();
		}
		
		//
		private var fightpro:FightPro;
		private var _fightProperty:String;
		private var _value:Number;
		
	}
}